﻿<%@ Page Title="" Language="C#" MasterPageFile="~/EmployeeSite.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MonkeyWarranty.Web.User.Default" %>
<%@ Import Namespace="Resources" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title><%= GlobalStrings.Home %></title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <fieldset class="register">
            <legend><%=GlobalStrings.WarrantyProducts %></legend>
            <div id="ProductsAtTechnical"></div>
        </fieldset>
    </div>
    
    <script type="text/javascript">
        $(document).ready(function () {
            LoadProductsAtTechnical();
        });
    </script>
    
    <script type="text/javascript">
        function LoadProductsAtTechnical() {
            $('#ProductsAtTechnical').jtable({
                paging: true,
                pageSize: 15,
                sorting: true,
                defaultSorting: 'Name ASC',
                actions: {
                    listAction: 'Default.aspx/ProductsAtTechnical'
                },
                fields: {
                    Id: {
                        key: true,
                        create: false,
                        edit: false,
                        list: false
                    },
                    //TicketCode: {
                    //    title: '<%= GlobalStrings.TicketCode %>',
                    //    display: function (data) {
                    //        return '<a href="ProcessProduct.aspx?id=' + data.record.Id + '" >' + data.record.TicketCode + '</a>';
                    //    }
                    //},
                    //Code: {
                    //    title: '<%= GlobalStrings.ProductCode %>',
                    //    display: function (data) {
                    //        return '<a href="ProcessProduct.aspx?id=' + data.record.Id + '" >' + data.record.Code + '</a>';
                    //    }
                    //},
                    Name: {
                        title: '<%= GlobalStrings.ProductName %>',
                        display: function (data) {
                            return '<a href="ProcessProduct.aspx?id=' + data.record.Id + '" >' + data.record.Name + '</a>';
                        }
                    },
                    EmployeeName: { title: '<%=GlobalStrings.TechnicalEmployees %>' },
                    Model: {
                        title: '<%= GlobalStrings.Model %>',
                        sorting: false
                    },
                    //ManufacturerName: {
                    //    title: '<%= GlobalStrings.Manufacturers %>',
                    //    sorting: false
                    //},
                    Serial: {
                        title: '<%= GlobalStrings.Serial %>',
                        sorting: false
                    },
                    //Quantity: {
                    //    width: '5%',
                    //    title: '<%= GlobalStrings.Quantity %>',
                    //    sorting: false
                    //},
                    CustomerName: { title: '<%= GlobalStrings.Customers %>', sorting: false },
                    Phone: { title: '<%= GlobalStrings.Phone %>', sorting: false }
                    //                    ErrorName: {
                    //                        title: '<%= GlobalStrings.ErrorCode %>'
                    //                    },
                    //                    WarrantyDate: {
                    //                        title: '<%= GlobalStrings.WarrantyDate %>',
                    //                        type: 'date',
                    //                        displayFormat: 'dd/mm/yy'
                    //                    }
                }
            });

            $('#ProductsAtTechnical').jtable('load');
            
            //setInterval(function () {
            //    $('#ProductsAtTechnical').jtable('load');
            //}, 300000);
        }
    </script>
</asp:Content>
